package com.zrrd.learn.wanzixi;

import java.util.Scanner;

/**
 * 游戏测试类
 *
 * @author wrn
 * @version 1.0
 * @date 2023/8/15 17:17
 */

public class GameTest {

    public static void main(String[] args) {
        //鸠摩智被攻击次数
        int num1 = 0;
        //乔峰被攻击次数
        int num2 = 0;



        System.out.println("输入1可以开始游戏,否则无法开始");
        Scanner s1 = new Scanner(System.in);
        int again = s1.nextInt();
        if (again==1){
            GameRole01 g1 = new GameRole01("鸠摩智",903,30,5);
            GameRole02 g2 = new GameRole02("乔峰",1080,25,8);
            int b1 = g1.getBlood();
            int b2 = g2.getBlood();

            int a1 = g1.getAggressivity();
            int a2 = g2.getAggressivity();

            for (int i = 0; b1!=0||b2!=0; i++) {
                System.out.println("\n输入1乔峰攻击鸠摩智,输入2鸠摩智攻击乔峰");
                Scanner s2 = new Scanner(System.in);
                int role = s2.nextInt();

                if (role==1){
                    b1-=20;
                    g1.blood01(g1.getRolename(),b1);
                    num1+=1;
                }
                if (role==2){
                    b2-=22;
                    g2.blood02(g2.getRolename(),b2);
                    num2+=1;
                }
                if (num1==3){
                    b1+=3;
                    g1.cast01(g1.getRolename(),b1,a1);
                }
                if (num2==8){
                    a2+=6;
                    g2.cast02(g2.getRolename(),b2,a2);
                }
            }

        } else {
            System.out.println("无法开始，请重新输入！");
        }




    }

}
